package nl.grol.yakshop.dataImport;

import java.io.InputStream;
import java.net.URL;
import java.util.List;

import nl.grol.yakshop.domain.model.Gender;
import nl.grol.yakshop.domain.model.YakFactory;
import nl.grol.yakshop.domain.model.YakHerd;
import nl.grol.yakshop.domain.model.YakI;
import nl.grol.yakshop.util.YakShopException;

import org.joda.time.DateTime;

import com.google.common.collect.Lists;

public class DummyHerdImporter implements HerdImporterI {

	@Override
	public YakHerd loadFromResource(URL resource) throws YakShopException {
		return createHerd();
	}
	
	@Override
	public YakHerd loadFromInputStream( InputStream is ) throws YakShopException {
		return createHerd();
	}

	private YakHerd createHerd() {
		DateTime now = DateTime.now();
		
		List<YakI> yaks = Lists.newArrayList();
		
		yaks.add( YakFactory.createYak("Betty-1", 4.0, Gender.female));
		yaks.add( YakFactory.createYak("Betty-2", 8.0, Gender.female));
		yaks.add( YakFactory.createYak("Betty-3", 9.5, Gender.female));
		
		return new YakHerd("Example", now, yaks);
	}

}
